package main

import (
	"test/gincircl/common"
	"test/gincircl/controller"
	"test/gincircl/logger"
	"test/gincircl/logger/config"

	"github.com/gin-gonic/gin"
)

func main() {
	logConfig := &config.Zap{
		Level:         "info",
		Prefix:        "[circl]",
		Format:        "console",
		Director:      "log",
		EncodeLevel:   "LowercaseLevelEncoder",
		StacktraceKey: "stacktrace",
		ShowLine:      true,
		LogInConsole:  true,
		RetentionDay:  -1,
	}
	common.Logger = logger.Zap(logConfig)
	r := gin.Default()

	kyber := r.Group("kyber")
	{
		kyber.POST("/GenKeyPair", controller.KyberGenKeyPair)
		kyber.POST("/Encapsulate", controller.KyberEncapsulate)
		kyber.POST("/Decapsulate", controller.KyberDecapsulate)
	}
	dilithium := r.Group("dilithium")
	{
		dilithium.POST("/GenKeyPair", controller.DilithiumGenKeyPair)
		dilithium.POST("/sign", controller.DilithiumSign)
		dilithium.POST("/verify", controller.DilithiumVerify)
	}
	r.Run(":8080")
}
